<?php
if (!isset($InputData['home_view'])) {
    $InputData['home_view'] = 0; //如果没有指定首页的内容 
}
require_once("{$CfgPara->root}/class/Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile() && !$detect->isTablet()) //判断是否手机
{
    //当前是移动设备 且不是平板 则为手机
    $isTablet = false;
    $viewRoot = "{$CfgPara->root}/view/";
    $viewEx = '.app.v.php';
} else {
    /**
     * 当前环境为平板或电脑
     */
    $isTablet = true;
    /**
     * 视图文件夹
     */
    $viewRoot = "{$CfgPara->root}/view/web/";
    /**
     * 视图后缀名
     */
    $viewEx = '.web.v.php';
}

if ($InputData['controller'] == 'home') {
    require("{$viewRoot}home_prefix{$viewEx}");
    require("{$viewRoot}home_suffix{$viewEx}");
} else {
    if (isset($LoadFrame) && $LoadFrame == 1) // 20170209 添加 如果需要加载框架
    {
        require("{$viewRoot}home_prefix{$viewEx}");
    }
    require("{$CfgPara->root}/controller/{$InputData['controller']}.c.php");
    if (isset($LoadFrame) && $LoadFrame == 1) {
        require("{$viewRoot}home_suffix{$viewEx}");
    }
}

